package com.shopping.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shopping.dao.IBaseDao;
import com.shopping.dao.Impl.IGoodsDao;
import com.shopping.model.Goods;
import com.shopping.service.IGoodsService;
/**
 * 商品表实现类
 * @author 吴飞
 *
 */
@Service
public class GoodsServiceImpl extends BaseServiceImpl<Goods> implements IGoodsService {

	@Autowired
	private IGoodsDao dao;
	
	@Override
	public IBaseDao<Goods> getBaseDao() {
		return dao;
	}

	@Override
	public Goods findById(Integer id) {
		return dao.selectById(id);
	}

	@Override
	public void updateStock(int id, int amount) {
		dao.updateStock(id, amount);
	}

	@Override
	public void updateSales(int id, int amount) {
		dao.updateSales(id, amount);
	}

}
